package judy.freechart;
	import java.io.File;

	import javax.swing.JFileChooser;
	import javax.swing.JFrame;

	public class FileFilter {
		public static String name;
	 public FileFilter() {
	  }

	  public static String open() {
	    JFileChooser chooser = new JFileChooser();
	    chooser.setCurrentDirectory(new File("."));

	    chooser.setFileFilter(new javax.swing.filechooser.FileFilter() {
	      public boolean accept(File f) {
	        return f.getName().toLowerCase().endsWith(".ini")
	            || f.isDirectory();
	      }

	      public String getDescription() {
	        return "ini file";
	      }
	    });

	    int r = chooser.showOpenDialog(new JFrame());
	    if (r == JFileChooser.APPROVE_OPTION) {
	      name = chooser.getSelectedFile().getName();
	      
	      ReadFile.setFileName(name);
	      JFreeChartDemo.trim(name);
	      
	    //  System.out.println(name);
	     
	    }
	    return name;
	  }
	}
